#ifndef __SOCKETOBSERVER__
#define __SOCKETOBSERVER__

#import <Foundation/Foundation.h>

@interface SocketObserver : NSObject
{
@protected
	CFRunLoopRef _runLoop;
	CFSocketRef _socket;
	CFRunLoopSourceRef _source;
	id _delegate;
	void* _context;
}

- (id) initWithRunLoop: (CFRunLoopRef) runLoop
	socket: (int) theSocket
	delegate: (id) delegate
	context: (void*) theContext;

- (CFRunLoopRef) runLoop;
- (int) socket;
- (id) delegate;
- (void) setDelegate: (id) delegate;
- (void*) context;
- (void) setContext: (void*) context;

@end

@interface NSObject(SocketObserverDelegate)

- (void) observeSocket: (int) theSocket context: (void*) theContext;

@end

#endif // __SOCKETOBSERVER__
